package frontend.model.admin;

import backend.model.admin.Activity;
import backend.model.admin.Department;
import backend.model.admin.Sfi;
import frontend.model.base.UIModel;

public class SfiUIModel implements UIModel<Sfi> {

    private String name;
    private String description;
    private Activity activity;
    private Department department;
    private boolean isActive;

    private Sfi sfi;

    public SfiUIModel() {
        sfi = new Sfi();
        isActive = true;
    }

    public SfiUIModel(Sfi sfi) {
        this.sfi = sfi;
        populateFieldsFromDBModel();
    }

    @Override
    public void populateFieldsFromDBModel() {
        name = sfi.getName();
        description = sfi.getDescription();
        activity = sfi.getActivity();
        department = sfi.getDepartment();
        isActive = sfi.getIsActive();
    }

    @Override
    public void populateDBModelFromFields() {
        sfi.setName(name);
        sfi.setDescription(description);
        sfi.setActivity(activity);
        sfi.setDepartment(department);
        sfi.setIsActive(isActive);
    }

    public String getName() {
        return name;
    }

    public String getDescription() {
        return description;
    }

    public Activity getActivity() {
        return activity;
    }

    public Department getDepartment() {
        return department;
    }

    @Override
    public Sfi getDBModel() {
        return sfi;
    }
}